const { defineConfig } = require('@vue/cli-service')

module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    port: 8081,
    open: false,
    host: 'localhost'
  },
  lintOnSave: false,
  chainWebpack: (config) => {
    // Inject Vue 3 esm-bundler feature flags to silence warnings and enable tree-shaking
    config.plugin('define').tap((args) => {
      Object.assign(args[0], {
        __VUE_OPTIONS_API__: JSON.stringify(true),
        __VUE_PROD_DEVTOOLS__: JSON.stringify(false),
        __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: JSON.stringify(false),
      })
      return args
    })
  }
})
